#define _CRT_SECURE_NO_WARNINGS 1

int turn(long long  x, int* i)
{
    if (x < 10)
        return x;
    else
        return turn(x / 10, i) + ((x % 10) * pow(10, (*i)++));
}

bool isPalindrome(int x)
{
    int i = 1;
    return x >= 0 && turn(x, &i) == x;
}